<template>
  <div v-loading="loading">
    <div class="p-4">
      <div class="row">
        <div class="col-sm-6">
          <div class="dl-wrap mb-1">
            <div class="dl-dt">业务申请码：</div>
            <div class="dl-dd">{{ infoData.apply_no }}</div>
          </div>
        </div>
        <div class="col-sm-6">
          <div class="dl-wrap mb-1">
            <div class="dl-dt">索赔人名称：</div>
            <div class="dl-dd">{{ infoData.claimer_name }}</div>
          </div>
        </div>
      </div>
      <div class="row">
        <div class="col-sm-6">
          <div class="dl-wrap mb-1">
            <div class="dl-dt">索赔金额：</div>
            <div class="dl-dd">{{ infoData.amount }}</div>
          </div>
        </div>
        <div class="col-sm-6">
          <div class="dl-wrap mb-1">
            <div class="dl-dt">发起时间：</div>
            <div class="dl-dd">{{ infoData.create_time }}</div>
          </div>
        </div>
      </div>

      <div class="row">
        <div class="col-sm-6">
          <div class="dl-wrap mb-1">
            <div class="dl-dt">索赔账号开户行名称：</div>
            <div class="dl-dd">{{ infoData.receive_bank_name }}</div>
          </div>
        </div>
        <div class="col-sm-6">
          <div class="dl-wrap mb-1">
            <div class="dl-dt">索赔账号开户行行号：</div>
            <div class="dl-dd">{{ infoData.receive_bank_no }}</div>
          </div>
        </div>
      </div>

      <div class="row">
        <div class="col-sm-12">
          <div class="dl-wrap mb-1">
            <div class="dl-dt">索赔原因：</div>
            <div class="dl-dd">{{ infoData.claim_reason }}</div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  components: {},
  props: {
    busId: String,
  },
  data() {
    return {
      loading: false,
      tableName: 'guarantee_claim_view',
      infoData: {},
    }
  },
  computed: {},
  watch: {
    busId: {
      handler: function () {
        this.getData()
      },
      immediate: true,
    },
  },
  created() {},
  mounted() {},
  methods: {
    async getData() {
      if (!this.busId) {
        return
      }
      this.loading = true

      this.$api
        .getData(this.$serviceName, this.tableName, { 'bus_id.eq': this.busId })
        .then(res => {
          this.infoData = res?.data?.[0] ?? {}
        })
        .finally(() => {
          this.loading = false
        })
    },
  },
}
</script>

<style lang="scss" scoped></style>
